package cn.sangyy.car.controller;

import cn.sangyy.basic.utils.AjaxResult;
import cn.sangyy.basic.utils.PageList;
import cn.sangyy.car.doc.CarDoc;
import cn.sangyy.car.query.CarSearchQuery;
import cn.sangyy.car.service.ICarSearchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


/**
 * @author SangYY
 * @date: 2023/05/30/9:49
 */
@RestController
@RequestMapping("/carSearch")
public class CarSearchController {

    @Autowired
    private ICarSearchService carSearchService;

    @PostMapping()
    public AjaxResult carSearch(@RequestBody CarSearchQuery query){
        PageList<CarDoc> pageList = carSearchService.search(query);
        return AjaxResult.me().setResultObj(pageList);
    }


}
